class DuckTest {
    public static void main(String[] args) {
        // 原有代码逻辑不变
        Duck mallard = new MallardDuck("绿色", 1.2);
        Duck rubberDuck = new RubberDuck("黄色", 0.3);

        System.out.println("=====绿头鸭行为=====");
        mallard.fly();
        mallard.quack();
        mallard.setHeavy(1.3);
        ((MallardDuck) mallard).setHeavy(1);

        System.out.println("\n=====橡胶鸭行为=====");
        rubberDuck.fly();
        rubberDuck.quack();
        rubberDuck.setHeavy(0.4);
        ((RubberDuck) rubberDuck).setHeavy(0.5, "千克");
    }
}